﻿using System;
using FreeSql.DataAnnotations;

namespace Colorful.Furniture.IEntity;

/// <summary>
///  更新人
/// </summary>
/// <typeparam name="TModifyUserPrimaryKey"></typeparam>
public interface IModifyUser<TModifyUserPrimaryKey>
{
    /// <summary>
    ///   更新人
    /// </summary>
    TModifyUserPrimaryKey ModifyUserId { get; set; }
}

/// <summary>
///  更新人
/// </summary>
public interface IModifyUserGuid : IModifyUser<Guid?>
{

}

/// <summary>
///  更新时间
/// </summary>
public interface IModifyTime
{
    /// <summary>
    ///  更新时间
    /// </summary>
    DateTime? ModifyTime { get; set; }
}

/// <summary>
///  更新领域聚合根
/// </summary>
public interface IModifyAggregateRoot<TModifyUserPrimaryKey> : IModifyUser<TModifyUserPrimaryKey>, IModifyTime
{

}

/// <summary>
///   更新领域聚合根
/// </summary>
public interface IModifyGuidAggregateRoot : IModifyAggregateRoot<Guid?>
{

}

/// <summary>
///   更新领域聚合根
/// </summary>
public class ModifyAggregateRoot : IModifyGuidAggregateRoot
{
    /// <summary>
    ///   更新人
    /// </summary>
    [Column(Name = "modify_user_id", CanInsert = false, Position = -87)]
    public Guid? ModifyUserId { get; set; }

    /// <summary>
    ///  更新时间
    /// </summary>
    [Column(Name = "modify_time", CanInsert = false, Position = -86)]
    public DateTime? ModifyTime { get; set; }
}

/// <summary>
///  更新领域租户聚合根
/// </summary>
public class ModifyTenantAggregateRoot : ITenantGuid
{
    /// <summary>
    ///  租户id
    /// </summary>
    [Column(Name = "tenant_id", Position = -83)]
    public Guid? TenantId { get; set; }
}

/// <summary>
///  更新领域软删除聚合根
/// </summary>
public class ModifySoftDeleteAggregateRoot : ISoftDelete
{
    /// <summary>
    ///  是否删除：0=未删除，1=已删除
    /// </summary>
    [Column(Name = "is_deleted", Position = -85)]
    public bool IsDeleted { get; set; }

    /// <summary>
    ///  删除时间
    /// </summary>
    [Column(Name = "deleted_time", Position = -84)]
    public DateTime? DeletedTime { get; set; }
}

/// <summary>
///  更新租户软删除聚合根
/// </summary>
public class ModifyTenantSoftDeleteAggregateRoot : ModifyTenantAggregateRoot, ISoftDelete
{ /// <summary>
  ///  是否删除：0=未删除，1=已删除
  /// </summary>
    [Column(Name = "is_deleted", Position = -85)]
    public bool IsDeleted { get; set; }

    /// <summary>
    ///  删除时间
    /// </summary>
    [Column(Name = "deleted_time", Position = -84)]
    public DateTime? DeletedTime { get; set; }

}